lib=libmyfunc.so

$(lib):func_1.o func_2.o
	g++ -shared -o $@ $^
	rm -f $^

func_1.o:func_1.cpp
	g++ -fPIC -c $^

func_2.o:func_2.cpp
	g++ -fPIC -c $^

.PHONY:clean
clean:
	rm -rf *.o *.so
	mv lib/myinclude/*.h ./
	rm -rf lib

.PHONY:output
output:
	mkdir -p lib/myinclude
	mkdir -p lib/mylib
	mv *.h lib/myinclude
	mv *.so lib/mylib